This invention relates to an image processing method, an image processing apparatus, and an image processing program, and more particularly, to an image processing method and an image processing apparatus which can improve the accuracy of color space transform of image data having a color space of a wide dynamic range, particularly, the accuracy of the color space transform using a three-dimensional lookup table (hereinafter, also referred to as “3DLUT”), an image processing program for causing a computer to execute the image processing method, and a computer-readable recording medium having the image processing program recorded thereon.
Scene-referred image representations having exact color information of imaged objects and sights are used for the purpose of exact color reproduction and are used as a reference of a captured image in color management. For example, the Academy of Motion Picture Arts and Sciences (AMPAS) defined a scene-referred wide dynamic range image color space (Academy Color Encoding Specification (ACES) color space), which is described in Non-Patent Document 1 (Specification S-2008-001, Academy Color Encoding Specification (ACES), The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Image Interchange Framework Subcommittee, Version 1.0, Aug. 12, 2008) in color management for movie production and uses it as a reference for matching colors of images captured with various cameras.
The ACES color space has a very wide dynamic range as described above, and image data of pixels is expressed as floating point numbers. At the time of image transform or the like, it is necessary to deal with the image data of a wide dynamic range as an input.
Output-referred image data is obtained by performing reference rendering transform (RRT), which is called rendering, on the image data in the ACES color space. The rendering (RRT) serves as contrast or color transform according to observation environments (brightness or color tone of a light source) and color transform for desirable reproduction (memory colors such as desirable flesh color, sky, and green). In the standard of AMPAS, the rendering (RRT) is defined by complicated numerical expressions. However, in an actual color transform system, these complicated numerical expressions can be hardly used without any change and thus need to be replaced with a three-dimensional lookup table (3DLUT).
The 3DLUT is a table in which output values Ro, Go, and Bo can be arbitrarily set for combinations of input values Ri, Gi, and Bi, where the input values can be set to be discrete and an input between the discrete values can be obtained from preceding and subsequent values thereof by interpolation.
An example of the table indicating the 3DLUT is shown in Table 1.
TABLE 1RiGiBiRoGoBo0000.120.080.010080.220.076.4500160.310.0515.23..................0800.2111.251.35..................256256256238.12248.35255.56
As the input values of the 3DLUT, combinations of R, G, and B of the same values with equal divisions are widely used from the viewpoint of convenience of operation. When the input values of the 3DLUT are expressed in a three-dimensional space of R, G, and B, the input values can be expressed as a grid-like cube illustrated in FIG. 11.
The 3DLUT illustrated in FIG. 11 covers a space of combination of all R, G, and B values in a range of 0 to 256.
In the case where transform from a color space of a wide dynamic range such as the ACES color space is performed using the 3DLUT, the range to be covered with the 3DLUT is broadened and thus high-accuracy transform cannot be performed without taking a large number of coordinates (grid points) of the input values designated discretely in the 3DLUT.
Accordingly, in the case where an image having a wide dynamic range is a target of transform, since outdoor sunlight is equal to or greater than 10000 cd/m2, moonlight is approximately 0.01 cd/m2, and a dynamic range is 6 (=Log10(10000/0.01)), it is thus necessary to apply a lookup table (hereinafter, also referred to as LUT) covering this range. In general, since input values of an LUT are values of equal-interval steps, 106=1000000 input values are required to cover the wide dynamic range, and besides, there is a problem in that a resolution is roughened in a dark area, and the human perception has a Log function relationship for brightness (Weber-Fechner's Law). Therefore, a method of implementing an LUT after performing Log transform on image data having linear brightness is suitably used. By applying the 3DLUT having input grid points of equal intervals to the data subjected to the Log transform, it is possible to approximate the transform with data, which is discretized by distribution for human perception.
Therefore, in a video transform architecture (a logical structure of computer hardware performing an image transform processing) proposed by the AMPAS, the 3DLUT is adopted to transform from the ACES color space into a color space for an output device.
FIG. 12 illustrates an image transform processing system 120 constructed on the basis of the video transform architecture proposed by the AMPAS.
In the image transform processing system 120 illustrated in FIG. 12, first, a camera image (video) 124 captured with a digital camera as an input device is input to a data input unit 122 and is acquired in the image transform processing system 120.
Image data of the camera image 124 (the color space of the digital camera) is transformed through input device transform (IDT) 128 or the like in an input transform unit 126 into image data of an ACES color space (input color space) 132 that is independent from the input device.
The image data transformed into the ACES color space 132 is subjected to editing/processing such as color adjustment in the ACES color space 132 in a color adjusting unit 130, is then transformed into an output color space (Output Color Encoding Specification (OCES) color space (not illustrated)) which is a color space common to the ACES color space 132 through reference rendering transform (RRT) 136 in an output transform unit 134, and is then transformed into image data of an output image 142 displayed on a display device 140 such as a digital projector through output device transform (ODT) 138.
In the image transform processing system 120 illustrated in FIG. 12, a 3DLUT is adopted to the combination of the RRT 136 and the ODT 138 in the output transform unit 134.
The 3DLUT used in the output transform unit 134 can be a 3DLUT 46 applied so as to entirely cover a color space 44 which is illustrated in FIG. 3B and which is the ACES color space 132 transformed through the IDT 128.